package com.flexcloudsdk.xmpp;

import java.util.logging.Logger;

import com.google.appengine.api.xmpp.Subscription;
import com.google.appengine.api.xmpp.SubscriptionType;
import com.google.appengine.api.xmpp.JID;

public class CloudSubscription {
    private static final Logger log = Logger.getLogger(CloudSubscription.class.getName());
	private Subscription subscription = null;
	
	public CloudSubscription() {
		log.info("CloudSubscription has been created by BlazeDS");
	}

	public void setSubScription(Subscription value) {
		subscription = value;
		if (subscription == null)
			log.severe("subscription value is invalid in setSubscription call in CloudSubscription!");
	}
	
	public JID getFromJid() {
		JID value = null;
		if (subscription != null)
		  value =  subscription.getFromJid();
		else
			log.severe("subscription value is invalid in getFromJid call in CloudSubscription!");
		return value;		
	}
	
	public String getStanza() {
		String value = null;
		if (subscription != null)
			value = subscription.getStanza();
		else
			log.severe("subscription value is invalid in 	getStanza call in CloudSubscription!");
		return value;
	}
	
	public SubscriptionType getSubscriptionType() {
		SubscriptionType type = null;
		if (subscription != null)
			type = subscription.getSubscriptionType();
		else
			log.severe("subscription value is invalid in 	getSubscriptionType call in CloudSubscription!");
		return type;
	}
	
	public JID getToJid() {
		JID jid = null;
		if (subscription != null)
			jid = subscription.getToJid();
		else
			log.severe("subscription value is invalid in 	getToJid call in CloudSubscription!");
		return jid;
	}
	
}
